/** 管理员API接口文件 */
import request from "./request";
const Req = new request()
export function login({username,password}) {
    return Req.post({
        url:"/login",
        data:{username,password}
    })
}

export function  loginout() {
   return Req.post({
       url: "/loginout",
       data:{}
   })
}

export function list(page=0,limit=10){
    return Req.get({
        url:'/adminlist',
        data:{
            page,
            limit
        }
    })
}
export function del(_id){
    return Req.post({
        url:'/admindelete',
        data:{
            _id
        }
    })
}
export function add({username,password,tel,avatarUrl,roles}){
    return Req.post({
        url:"/adminadd",
        data:{
            username,password,tel,avatarUrl,roles
        }
    })
}

